﻿<div class="tabbable">
	<ul class="nav nav-tabs" id="myTab">
		<li class="active">
			<a data-toggle="tab" href="#tab1">
				用户管理
			</a>
		</li>
	
		<li class="tab-red">
			<a data-toggle="tab" href="#tab2">
				添加用户
			</a>
		</li>
	</ul>
	<div class="tab-content">
		<div id="tab1" class="tab-pane active">
			<div role="grid" id="editabledatatable_wrapper" class="dataTables_wrapper form-inline no-footer">
				<table class="table table-striped table-hover table-bordered dataTable no-footer" id="editabledatatable" aria-describedby="editabledatatable_info">
					<thead class="bordered-bottom-1 bordered-orange">
					<tr>
						<th class="text-center">ID</th>
						<th class="text-center">登录名</th>
						<th class="text-center">昵称</th>
						<th class="text-center">用户组</th>
						<th class="text-center">状态</th>
						<th class="text-center">创建时间</th>
						<th class="text-center">操作</th>
					</tr>
					</thead>

					<tbody>
					<?php
						foreach( $users as $u ):
					?>
					<tr>
						<td class="text-center"><?=$u->id;?></td>
						<td class="text-center"><?=$u->uid;?></td>
						<td class="text-center"><?=$u->name;?></td>
						<td class="text-center"><?=$u->group;?></td>
						<td class="text-center"><i class="glyphicon glyphicon-<?=$u->canlog ? 'ok' : 'remove' ;?>"></i></td>
						<td class="text-center"><?=$u->ctime;?></td>
						<td class="text-center">
							<button class="btn btn-info btn-xs edit" onclick="show_modal('modal', '<?=site_url( 'user/edit_user' ). '/' .$u->id;?>')"><i class="fa fa-pencil"></i>编辑</button>
							<button class="btn btn-danger btn-xs delete" onclick="bb_confirm( '确定要删除 <?=$u->name;?> 吗？', '<?=site_url('user/do_del_user'). '/' .$u->id;?>' )"><i class="fa fa-trash-o"></i> 删除</button>
							<button class="btn btn-maroon btn-xs delete" onclick="bb_confirm( '确定要重置 <?=$u->name;?> 的密码吗？', '<?=site_url('user/do_reset_password'). '/' .$u->id;?>')"><i class="fa fa-key"></i>重置密码</button>
						</td>
					</tr>
					<?php
						endforeach;
					?>
					</tbody>
				</table>
			</div>
		<div class="clearfix"></div>
	</div>
	<div id="tab2" class="tab-pane">
		<form class="form">
			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">用户名</label>
				<div class="col-md-11">
					<div class="form-group">
						<input type="text" class="form-control" name="uid" id="uid" placeholder="用户名">
					</div>
				</div>
			</div>
			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">昵称</label>
				<div class="col-md-11">
					<div class="form-group">
						<input type="text" class="form-control" name="name" id="name" placeholder="昵称">
					</div>
				</div>
			</div>

			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">密码</label>

				<div class="col-md-11">
					<div class="form-group">
						<input type="password" class="form-control" name="password1" placeholder="密码">
					</div>
				</div>
			</div>

			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">确认密码</label>

				<div class="col-md-11">
					<div class="form-group">
						<input type="password" class="form-control" name="password2" placeholder="再输入一次密码">
					</div>
				</div>
			</div>

			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">Email</label>

				<div class="col-md-11">
					<div class="form-group">
						<input type="email" class="form-control" name="email" placeholder="电子邮件地址">
					</div>
				</div>
			</div>
			<div class="form-group clearfix form-bordered">
				<label class="control-label col-md-1">用户组</label>

				<div class="col-md-4">
					<div class="form-group">
						<select class="select" name="groups" id="groups">
						<?php
							foreach( $groups as $g ):
						?>
							<option value="<?=$g->id;?>"><?=$g->name;?></option>
						<?php
							endforeach;
						?>
						</select>
					</div>
				</div>

				<label class="control-label col-md-1">状态</label>

				<div class="col-md-4">
					<div class="form-group">
						<select class="select" name="canlog" id="canlog">
							<option value="1">启用</option>
							<option value="0">禁用</option>
						</select>
					</div>
				</div>
			</div>
			<div class="form-group text-right clearfix">
				<button class="btn btn-success" type="button" id="add_user">添加</button>
				<button class="btn btn-default" onclick="window.location.reload()">取消</button>
			</div>
		</form>
	</div>
</div>
</div>